package com.hmkj.core.mapper.seller;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.model.seller.SellerModel;
import com.hmkj.core.model.userAuth.UserAuthModel;
import com.hmkj.core.po.seller.Seller;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 内部用户表相关Dao接口<br>
 *
 * @author lizhijie
 * @date   2018-07-05 03:09:33
 */
public interface SellerMapper extends GenericMapper< Seller,Integer> {

    @Select("SELECT t.*,u.user_name AS 'u.userName',u.mobile_phone AS 'u.mobilePhone' FROM s_seller t LEFT JOIN biz_user u ON t.user_id = u.id WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<SellerModel> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1) FROM s_seller t LEFT JOIN biz_user u ON t.user_id = u.id  WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);
}
